package com.guchenbo.schedule.biz;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author guchenbo
 * @date 2021/4/11
 */
@Component
public class DemoTask {

  protected static final Logger log = LoggerFactory.getLogger(DemoTask.class);

  @Autowired
  private UserMgr userMgr;

//  @Scheduled(cron = "0/15 * * * * ?")
//  @SchedulerLock
  public void sayHello() {
    log.info("schedule task say hello");
  }

//  @Scheduled(cron = "0/15 * * * * ?")
  public void m2() {
    System.out.println(userMgr.hello());
    System.out.println(userMgr.hello("jay"));
  }
}
